let LS = {
  set (key, val) {
    localStorage.setItem(key, val ? JSON.stringify(val) : '')
  },
  get (key) {
    let val = localStorage.getItem(key)
    return val && val !== 'undefined' && val !== 'null' ? JSON.parse(localStorage.getItem(key)) : null
  },
  remove (key) {
    localStorage.removeItem(key)
  },
  setItem: localStorage.setItem,
  getItem: localStorage.getItem
}

export default LS
